﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace luanvanFinal
{
    class clsDeveloper
    {
        int id;
        String name;
        int pm;
        String phone;
        String email;
        String note;
        String username;
        String pass;

        public int Id
        {
            get { return id; }
            set { id = value; }
        }
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        public int Pm
        {
            get { return pm; }
            set { pm = value; }
        }
        public string Phone
        {
            get { return phone; }
            set { phone = value; }
        }
        public string Email
        {
            get { return email; }
            set { email = value; }
        }
        public string Note
        {
            get { return note; }
            set { note = value; }
        }
        public string Username
        {
            get { return username; }
            set { username = value; }
        }
        public string Pass
        {
            get { return pass; }
            set { pass = value; }
        }
        public clsDeveloper()
        {
            id = 0;
            name = "";
            pm = 0;
            phone = "";
            email = "";
            note = "";
            username = "";
            name = "";
        }

        public String getIdFromName(string name)
        {
            String strSQL = "select id from developer where userName = '" + name + "'";
            clsConnect ketnoi = new clsConnect();
            ketnoi.openConnection();
            SqlDataAdapter da = new SqlDataAdapter(strSQL, ketnoi.Connection);
            DataTable dt = new DataTable();
            da.Fill(dt);
            ketnoi.closeConnection();
            return dt.Rows[0][0].ToString();
        }

    }
}
